Conversation
| .concat()) | ||
| } | ||
|
|
||
| pub fn compiler_args_for_diagnostics( |
There was a problem hiding this comment.
Please add a comment why this exists.
rewatch/src/mcp.rs
Outdated
| fn list_tools(&self) -> Vec<mcp_spec::tool::Tool> { | ||
| vec![Tool::new( | ||
| "diagnose", | ||
| "Quick per-file diagnostics after edits; prefer before full build; no writes; only this file.", |
There was a problem hiding this comment.
You might want to clarify what path is here.
I know it is a .res or .resi path, preferably the full path, but if left unspecified the LLM might call this with some other path.
| let name = tool_name.to_string(); | ||
| Box::pin(async move { | ||
| match name.as_str() { | ||
| "diagnose" => { |
There was a problem hiding this comment.
This seems rather horrible that we need to parse the tool name ourselves. Is there no better abstraction for this?
| fn instructions(&self) -> String { | ||
| "ReScript MCP server.\n\n\ | ||
| Tools:\n\ | ||
| - diagnose(path): Quick per-file diagnostics after edits. Prefer this before a full build.\n\ |
There was a problem hiding this comment.
This tool call does feel a bit like duplication of one of the LSP endpoints.
It makes me wonder if we should explore having an LSP client inside the MCP tool that can ask this information from the running LSP Server.
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
488eeb2 to
5902225
Compare
|
@zth what's the status of this? It'd be cool to have it. Can this MCP server respond while rewatch is in watch mode ? This is a frustrating limit today that you can't both have rescript in watch mode and have your agent run a build to get feedback from the compiler. |
This bootstrap a simple MCP for ReScript, through Rewatch. Initially it adds a single command
diagnose, which will run quick diagnostics for a single file. Diagnostics here means that we'll run a compilation only on the single file targeted, no dependents, so it's really quick. Warnings and errors are returned to the LLM.Supersedes #7566.